/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package continuity;

import java.io.IOException;

/**
 *
 * @author FornetTeam
 */
public class EmptyElement extends Element {
    /**
     * Beállítjuk, hogy ide lehet lépni.
     * @param game az interface amin keresztül kommunikálunk 
     */
    public EmptyElement(Communication game) {
        super(game);
        canMove=true;
    }

    /**
     * Megvizsgálja, hogy meghalt-e a karakter. Ha nincs alatta talaj, akkor igen.
     * @throws IOException 
     */
    @Override
    public void doSomething() {

        if(super.parent.getNeighbor(Direction.Down.toInt()) == null){
            
            if(parent.getIsHere(0) == true && parent.getIsHere(1) == false) {
                game.reloadCharacter(0);
            }
            
            if(parent.getIsHere(0) == false && parent.getIsHere(1) == true) {
                game.reloadCharacter(1);
            }
                
            if(parent.getIsHere(0) == true && parent.getIsHere(1) == true){
                game.reloadCharacter(0);
                game.reloadCharacter(1);
            }
        }
    }
    @Override
    public String toString() {
        return "Em";
    }
}
